﻿using System;

namespace Tomato.Allure
{
	public class AllureEventArgs
	{
	}

	public class BuildEventArgs : AllureEventArgs
	{
		private BuildScope m_buildScope;

		public BuildScope BuildScope
		{
			get { return m_buildScope; }
		}

		private BuildAction m_buildAction;

		public BuildAction BuildAction
		{
			get { return m_buildAction; }
		}

		public BuildEventArgs( BuildScope buildScope, BuildAction buildAction )
		{
			m_buildScope = buildScope;
			m_buildAction = buildAction;
		}
	}

	public class SolutionEventArgs : AllureEventArgs
	{
		public SolutionEventArgs()
		{
		}
	}

	public class SolutionRenamedEventArgs : SolutionEventArgs
	{
		private string m_previousName;

		public string PreviousName
		{
			get { return m_previousName; }
		}

		public SolutionRenamedEventArgs( string previousName )
		{
			m_previousName = previousName;
		}
	}

	public class ProjectEventArgs : AllureEventArgs
	{
		private IProject m_project;

		public IProject Project
		{
			get { return m_project; }
		}

		public ProjectEventArgs( IProject project )
		{
			m_project = project;
		}
	}

	public class ProjectRenamedEventArgs : ProjectEventArgs
	{
		private string m_previousName;

		public string PreviousName
		{
			get { return m_previousName; }
		}

		public ProjectRenamedEventArgs( IProject project, string previousName )
			: base( project )
		{
			m_previousName = previousName;
		}
	}

	public class ProjectItemEventArgs : AllureEventArgs
	{
		private IProjectItem m_projectItem;

		public IProjectItem ProjectItem
		{
			get { return m_projectItem; }
		}

		public ProjectItemEventArgs( IProjectItem projectItem )
		{
			m_projectItem = projectItem;
		}
	}

	public class ProjectItemRenamedEventArgs : ProjectItemEventArgs
	{
		private string m_previousName;

		public string PreviousName
		{
			get { return m_previousName; }
		}

		public ProjectItemRenamedEventArgs( IProjectItem projectItem, string previousName )
			: base( projectItem )
		{
			m_previousName = previousName;
		}
	}

	public class DocumentEventArgs : AllureEventArgs
	{
		private IDocument m_document;

		public IDocument Document
		{
			get { return m_document; }
		}

		public DocumentEventArgs( IDocument document )
		{
			m_document = document;
		}
	}

	public class DocumentOpeningEventArgs : AllureEventArgs
	{
		private string m_documentPath;
		private bool m_bReadOnly;

		public string DocumentPath
		{
			get { return m_documentPath; }
		}

		public bool IsReadOnly
		{
			get { return m_bReadOnly; }
		}

		public DocumentOpeningEventArgs( string documentPath, bool bReadOnly )
		{
			m_documentPath = documentPath;
			m_bReadOnly = bReadOnly;
		}
	}

	public class WindowEventArgs : AllureEventArgs
	{
		private IWindow m_window;

		public IWindow Window
		{
			get { return m_window; }
		}

		public WindowEventArgs( IWindow window )
		{
			m_window = window;
		}
	}

	public class WindowActivatedEventArgs : AllureEventArgs
	{
		private IWindow m_windowActivated;
		private IWindow m_windowDeactivated;

		public IWindow ActivatedWindow
		{
			get { return m_windowActivated; }
		}

		public IWindow DeactivatedWindow
		{
			get { return m_windowDeactivated; }
		}

		public WindowActivatedEventArgs( IWindow activatedWindow, IWindow deactivatedWindow )
		{
			m_windowActivated = activatedWindow;
			m_windowDeactivated = deactivatedWindow;
		}
	}

	public class WindowMovedEventArgs : WindowEventArgs
	{
		private int m_left;
		private int m_top;
		private int m_width;
		private int m_height;

		public int Left { get { return m_left; } }
		public int Top { get { return m_top; } }
		public int Width { get { return m_width; } }
		public int Height { get { return m_height; } }

		public WindowMovedEventArgs( IWindow window, int left, int top, int width, int height )
			: base( window )
		{
			m_left = left;
			m_top = top;
			m_width = width;
			m_height = height;
		}
	}

	public class TimeElapsedEventArgs : AllureEventArgs
	{
		private TimeSpan m_elapsedTime;

		public TimeSpan ElapsedTime { get { return m_elapsedTime; } }

		public TimeElapsedEventArgs( TimeSpan elapsedTime )
		{
			m_elapsedTime = elapsedTime;
		}
	}

	public class OutputPaneEventArgs : AllureEventArgs
	{
		private IOutputWindowPane m_outputPane;

		public IOutputWindowPane OutputPane
		{
			get { return m_outputPane; }
		}

		public OutputPaneEventArgs( IOutputWindowPane outputPane )
		{
			m_outputPane = outputPane;
		}
	}

#if false
	public delegate void BuildEventHandler( BuildScope buildScope, BuildAction buildAction );
	public delegate void SolutionEventHandler();
	public delegate void SolutionRenamedEventHandler( string oldName );
	public delegate void ProjectEventHandler( IProject project );
	public delegate void ProjectRenamedEventHandler( IProject project, string oldName );
	public delegate void ProjectItemEventHandler( IProjectItem projectItem );
	public delegate void ProjectItemRenamedEventHandler( IProjectItem projectItem, string oldName );
	public delegate void DocumentEventHandler( IDocument document );
	public delegate void DocumentOpeningEventHandler( string documentPath, bool bReadOnly );
	public delegate void WindowEventHandler( IWindow window );
	public delegate void WindowActivatedEventHandler( IWindow gotFocus, IWindow lostFocus );
	public delegate void WindowMovedEventHandler( IWindow window, int top, int left, int width, int height );
	public delegate void TimeElapsedEventHandler( TimeSpan elapsedTime );

	public interface IEvents
	{
		event BuildEventHandler OnBuildBegin;
		event BuildEventHandler OnBuildDone;

		event SolutionEventHandler OnSolutionClosing;
		event SolutionEventHandler OnSolutionClosed;
		event SolutionEventHandler OnSolutionOpened;
		event SolutionRenamedEventHandler OnSolutionRenamed;

		event ProjectEventHandler OnProjectAdded;
		event ProjectEventHandler OnProjectRemoved;
		event ProjectRenamedEventHandler OnProjectRenamed;

		event ProjectItemEventHandler OnSolutionItemAdded;
		event ProjectItemEventHandler OnSolutionItemRemoved;
		event ProjectItemRenamedEventHandler OnSolutionItemRenamed;

		event ProjectItemEventHandler OnProjectItemAdded;
		event ProjectItemEventHandler OnProjectItemRemoved;
		event ProjectItemRenamedEventHandler OnProjectItemRenamed;

		event ProjectItemEventHandler OnMiscFileItemAdded;
		event ProjectItemEventHandler OnMiscFileItemRemoved;
		event ProjectItemRenamedEventHandler OnMiscFileItemRenamed;

		event DocumentOpeningEventHandler OnDocumentOpening;
		event DocumentEventHandler OnDocumentOpened;
		event DocumentEventHandler OnDocumentClosing;
		event DocumentEventHandler OnDocumentSaved;

		event WindowEventHandler OnWindowClosing;
		event WindowActivatedEventHandler OnWindowActivated;
		event WindowEventHandler OnWindowCreated;
		event WindowMovedEventHandler OnWindowMoved;
		event WindowEventHandler OnWindowShowing;
		event WindowEventHandler OnWindowHiding;

		event TimeElapsedEventHandler OnTimeElapsed;
	}
#endif
}




